<?php
/**
* demo
*/
class Default_DefaultController extends Core_Controller
{
    function indexAction()
    {
        $this->view->parsePage('index');
        $this->view->render();
    }

    function pageAction()
    {
        $this->view->parsePage($_REQUEST['xml']);
        $this->view->render();
    }

    function notFoundAction()
    {
        header('HTTP/1.1 404 Not Found');
        $this->view->parsePage('404');
        if (!$this->view->render()) {
            include ROOT_DIR . DS . '404.html';
        }
    }

    function errorAction()
    {
        $errors = print_r(func_get_args(), true);
        if (!empty($errors)) {
            $number = md5($errors);
            Core_IoUtils::instance()->writeFile(ROOT_DIR . DS . 'asset' . DS . 'internal' . DS . 'report' . DS . $number . '.txt', $errors);
            $GLOBALS['report'] = $number;
        }
        $dir = dirname(__FILE__);
        include $dir . DS . 'tpl' . DS . 'theme/error.phtml';
    }

}
